﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class cn_common_menu_file : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GetCategory();
        }
    }


    private void GetCategory()
    {
        //下级栏目
        //string sqlStr = "select * from Whir_Column where parentID = 70  order by sort asc";
        //DataTable dt = Whir.SQLServerDAL.DbHelperSQL.Query(sqlStr).Tables[0];
        //if (dt != null && dt.Rows.Count > 0)
        //{
        //    this.rptList.DataSource = dt;
        //    rptList.DataBind();
        //}

        string sql = "SELECT top 4 * FROM Whir_U_News WHERE  TypeID=60 order by CreateDate desc";
        DataTable dtAudit = Whir.SQLServerDAL.DbHelperSQL.Query(sql).Tables[0];
        rptList.DataSource = dtAudit;
        rptList.DataBind();

    }
    protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        //DataRowView dr = e.Item.DataItem as DataRowView;
        //Literal ltrImg = e.Item.FindControl("ltrImg") as Literal;
        //Literal ltrContent = e.Item.FindControl("ltrContent") as Literal;

        //string ColumnId = dr["columnID"].ToString();

        //string sql = "select Content,Img from Whir_U_SinglePage where TypeId=" + ColumnId;
        //DataTable dt = Whir.SQLServerDAL.DbHelperSQL.Query(sql).Tables[0];
        //if (dt != null && dt.Rows.Count > 0)
        //{
        //    ltrContent.Text= Whir.Common.WebHelper.StringHelper.CutString(dt.Rows[0]["Content"].ToString(),120);
        //    ltrImg.Text = string.Format("<a href=\"about.aspx?cid={1}&mode=kbjd\" ><img src=\"{0}\" width=\"185\" height=\"77\"></a>", Whir.Common.Settings.GetPicServer() + dt.Rows[0]["Img"].ToString(), ColumnId);
        //}

    }
}
